package com.wujie.liu.section03;

/**
 * Created by wujieliu on 2018/1/18.
 */
class Mug {
    static {
        System.out.println(" mug static block");
    }
    Mug(int maker) {
        System.out.println("Mug(" + maker + ")");
    }

    void f(int maker) {
        System.out.println("f(" + maker + ")");
    }
}

public class Mugs {
    Mug mug1;
    Mug mug2;

    static {
        System.out.println(" mugs static block");
    }

    {
        mug1 = new Mug(1);
        mug2 = new Mug(2);
        System.out.println("mug1 & mug2 initialized");
    }

    Mugs() {
        System.out.println("Mugs");
    }

    Mugs(int i) {
        System.out.println("Mugs(int)");
    }

    public static void main(String[] args) {
        System.out.println("Inside main()");
        new Mugs();
        System.out.println("new Mugs() Completed");
        new Mugs(1);
        System.out.println("new Mugs(1) Completed");
    }
}


